{ include("common.asl") }

!init.
 
+!create_artifacts
   <-  
   !create_artifact("KnowledgeSuppling", "artifacts.KnowledgeSupplingArt", []);
   !create_artifact("KITCredentials", "artifacts.KITCredentialsArt", []);
   !create_artifact("WorkerProfiles", "artifacts.KITWorkerProfilesArt", []);
   !create_artifact("WorkMemory", "artifacts.WorkMemoryArt", []). 
   //!create_artifact("KnowledgeStorage", "artifacts.KwoledgeStorageArt", []);
   //!create_artifact("KnowledgeBase", "artifacts.KwoledgeBaseArt", []);
   //!create_artifact("DomainCredentials", "artifacts.DomainCredentialsArt", []);
   //!create_artifact("KITAutentication", "artifacts.KITAutenticationArt", []);
   
   //!create_artifact("KITAutentication", "artifacts.KITAutenticationArt", []);
   //!create_artifact("KDAuthentication", "artifacts.KDAuthenticationArt", []);
   //!create_artifact("KnowledgeRequest", "artifacts.KnowledgeRequestArt", []);
   //!create_artifact("KDCredentials", "artifacts.KDCredentialsArt", []);   
  // !create_artifact("ParserXML", "artifacts.ParserXML", []).
  
+!create_organisational_artifacts
    <- 
    	// Create the group artifact
		makeArtifact("kmGroup","ora4mas.nopl.GroupBoard",["src/integration-os.xml", kmGroup, false, true ],GrArtId);
		adoptRole(knowledge_coordinator_role)[artifact_id(GrArtId)];
		focus(GrArtId);
		      
		// Create de scheme artifact
		makeArtifact("kmScheme", "ora4mas.nopl.SchemeBoard",["src/integration-os.xml", store_relevant_information_scheme, false, true], SchArtId);
		focus(SchArtId);
		?formationStatus(ok)[artifact_id(GrArtId)]; // see plan belows to ensure we wait until it is well formed
		addScheme("kmScheme")[artifact_id(GrArtId)].

+!init
   <- println;
	  .my_name(Me);
      println("--- Coordinator Agent ---");
      println(Me);	  
	  println;
      createWorkspace("integrationWorkspace");
      joinWorkspace("integrationWorkspace",_);
      //!create_organisational_artifacts;
      !create_artifacts.
      


      
